package com.dmgis.hndz.pojo;

import lombok.Data;

import java.util.Arrays;
import java.util.Objects;

@Data
public class LayerRcoDto {

    /**
     * 属性
     */
    private Object rcoValObject;
    /**
     * 经度
     */
    private Double lon;
    /**
     * 纬度
     */
    private Double lat;
    /**
     * 实体点集
     */
    private double[][] pos;
    /**
     * 图层对应实体class
     */
    private Class objectClass;

    private Dopxml dopxml;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LayerRcoDto that = (LayerRcoDto) o;
        if (Objects.equals(lon, that.lon) && Objects.equals(lat, that.lat) && objectClass == that.getObjectClass()){
            try{
                return rcoValObject.equals(that.rcoValObject);
            } catch (Exception e){
                return false;
            }

        }
        return false;
    }

    @Override
    public int hashCode() {
        int result = Objects.hash( lon, lat);
        result = 31 * result + Arrays.hashCode(pos);
        return result;
    }
}
